﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FW.Manager
{
    public class CacheManager
    {
        private Dictionary<string, object> Cache;
        private static CacheManager instance = new CacheManager();
        public static CacheManager Instance
        {
            get
            {
                return CacheManager.instance;
            }
        }

        public CacheManager()
        {
            Cache = new Dictionary<string, object>();

        }

        public void Add(string key, object value)
        {
            if (Cache.ContainsKey(key))
            {
                Cache[key] = value;
            }
            else
            {
                Cache.Add(key, value);
            }
        }
        public object Get(string key)
        {
            return Cache[key];
        }

    }
}
